<?php
	class MessageModel extends Model{
		public function select_message($cid){
			$list = D('message')->where(array('to'=>$cid,'is_del'=>0))->order('ctime DESC')->findPage(20);
			foreach($list['data'] as $k=>$v){
				$list['data'][$k]['reply'] = D('message_reply')->where(array('mid'=>$list['data'][$k]['mid'],'is_del'=>0))->select();
			}
			return $list;
		}
	}
?>